<?php $this->pageTitle = 'Reset Password'; ?>
<?php
$this->breadcrumbs = array(
	'All Users' => array('users/index'),
	$user->name => array('users/view', 'id' => $user->id),
	'Edit User'
);
?>
<script type="text/javascript">
	var userId = <?php echo $user->id; ?>;
	var selectedOverride;
</script>
<?php $this->renderPartial('_tabs', array('user' => $user)); ?>
<div class="grid_10">
	<div class="section">
		<div class="block">
			<?php if (!isset($randomPassword)): ?>
				<div class="form">
					<?php
					$form = $this->beginWidget('GxActiveForm', array(
						'id' => 'agent-form',
						'enableAjaxValidation' => false,
						'action' => array('users/resetpw', 'id' => $user->id, 'confirm' => '1')
							));
					?>
					<h2>Reset Password?</h2>

					<div class="row">
						<input id="sendEmail" type="checkbox" name="sendEmail" value="1" checked />
						<label for="sendEmail">Send new password to user via Email</label>            
					</div>
					<div class="row">
						<input id="sendSMS" type="checkbox" name="sendSMS" value="1" checked />
						<label for="sendSMS">Send new password to user via SMS</label>            
					</div>

					<?php
					echo GxHtml::Button(Yii::t('app', 'Cancel'), array(
						'submit' => array('/user/update', 'id' => $user->id),
						'class' => 'link-button no-margin'
					));
					echo GxHtml::submitButton(Yii::t('app', 'Ok'), array('class' => 'green link-button'));
					?>
					<?php $this->endWidget(); ?>
				<?php else: ?>
					<div class="form">
						<h2>Password Reset</h2>

						<p>
							Random Password: <strong><?php echo $randomPassword; ?></strong>
						</p>

						<?php
						echo GxHtml::Button(Yii::t('app', 'Back'), array(
							'submit' => array('users/update', 'id' => $user->id),
							'class' => 'link-button no-margin'
						));
						?>
					</div>
				<?php endif; ?>
			</div>
		</div>
	</div>
</div>